<!--#INCLUDE FILE="config.asp"-->
<!--#include file="../Email/email.asp"-->
<%
reservation = request("reservationCode")
guestid = request("GuesId")
actualArrival = request("actualArrival")
actualDeparture = request("actualDeparture")
travelId = request("travelId")

		set objConnect = server.createObject("ADODB.Connection")       
		objConnect.open conStr

		Set oCmd = Server.CreateObject("ADODB.Command")

		oCmd.ActiveConnection = objConnect
		oCmd.CommandText = "sp_update_new_Reservation" 
		oCmd.CommandType = 4

		Set ReservationCode = oCmd.CreateParameter("@ReservationCode", 200,1,100, reservation)
		oCmd.Parameters.Append ReservationCode
		
		Set guidId = oCmd.CreateParameter("@guestId", 3,1,100, guestid)
		oCmd.Parameters.Append guidId
		
		Set actualArrival = oCmd.CreateParameter("@actualArrival", 200,1,100, actualArrival)
		oCmd.Parameters.Append actualArrival
		
		Set actualDeparture = oCmd.CreateParameter("@actualDeparture", 200,1,100, actualDeparture)
		oCmd.Parameters.Append actualDeparture
		
		Set travelId = oCmd.CreateParameter("@travelId", 200,1,100, travelId)
		oCmd.Parameters.Append travelId
		
		Set userId = oCmd.CreateParameter("@userId", 3,1,100,session("CostabajaId"))
		oCmd.Parameters.Append userId

		set rss = oCmd.execute
		

	Dim useremail
	Dim FEiEmail
	
	FEiEmail="fulfillment@feifinancial.com"
	
	sqlstring = "SELECT * FROM Guests WHERE GuestID = "&guestid

	set TblTemp = server.createobject("Adodb.Recordset")
		
		TblTemp.Open Sqlstring, objConnect
		
		If Not TblTemp.EOF Then
			useremail = TblTemp("Email")
		End if
		
	Set TblTemp.Close
	set TblTemp = nothing
	
	'send mail
	
	From = "chrisburres@e-webstyle.com;fulfillment@feifinancial.com"
	FEiEmail = FEiEmail & ";" & useremail
	Subject = "Confirmed Date and Scheduled call to collect data Guest"
	strBody = "Dear " & ",<BR>"	
	strBody = strBody & "This is email sent from CallCenter <br/>"	
	strBody = strBody & "Thanks!"		
	
	On Error Resume Next 
		Call EmailCdonts(From,FEiEmail,"",Subject,strBody ,0,"",2)
		
	If Err.Number <> 0 Then
	   
	  Response.Write("This means there is most likely a problem with the" & vbCrLf)
	  Response.Write("""ConnectionString"" info that you specified.<br>" & vbCrLf)
	  Response.End
	  
	Else 
		Set oCmd1 = Server.CreateObject("ADODB.Command")

		oCmd1.ActiveConnection = objConnect
		oCmd1.CommandText = "sp_update_approvar_guest" 
		oCmd1.CommandType = 4
		
		Set actualArrival = oCmd1.CreateParameter("@actualArrival", 200,1,100, actualArrival)
		oCmd1.Parameters.Append actualArrival
		
		Set guestid = oCmd1.CreateParameter("@guestid", 3,1,100, guestid)
		oCmd1.Parameters.Append guestid
		
		Set userid = oCmd1.CreateParameter("@userid", 3,1,100,session("AdminId"))
		oCmd1.Parameters.Append userid

		set rss1 = oCmd1.execute
	End if
	
	
%>